<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>标签的显示与隐藏</title>
</head>
<body>
    <div class="title">
        <input type="button" value="切换显示" @click="func">
        <p v-if="surprise">点两下有惊喜哦~</p>
        <p v-if="today>=18">你今天真好看！💕</p>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        var title=new Vue({
            el:".title",
            data:{
                today:15,
                surprise:false
            },
            methods:{
                func:function(){
                    this.surprise=!this.surprise;
                    this.today++;
                }
            }
        })
    </script>
</body>
</html>